<template>
  <div class="merchant">
    <p style="font-size: 20px">{{ pageData.name }}</p>
    <div class="rate">
      <van-rate
        v-model="pageData.score"
        :size="16"
        color="#ffd21e"
        void-icon="star"
        void-color="#eee"
        allow-half
      />
      <span>月售{{ pageData.sellCount }}单</span>
      <span>已收藏</span>
    </div>
    <div class="price">
      <div class="price-item">
        <span>起送价</span>
        <p>{{ pageData.minPrice }} <span>元</span></p>
      </div>
      <div class="price-item">
        <span>商家配送</span>
        <p>{{ pageData.deliveryPrice }} <span>元</span></p>
      </div>
      <div class="price-item">
        <span>平均配送时间</span>
        <p>{{ pageData.deliveryTime }} <span>分钟</span></p>
      </div>
    </div>
    <div class="play">
      <div class="play-title">公告与活动</div>
      <div style="color: red">{{ pageData.bulletin }}</div>
    </div>
    <div class="supports">
      <div class="before-div" style="color: aliceblue; background-color: black">
        惠
      </div>
      <span>单人精彩套餐</span>
    </div>
    <div class="supports">
      <div
        class="before-div"
        style="color: aliceblue; background-color: #2b71f4"
      >
        折
      </div>
      <span>VC无限橙果汁全场8折</span>
    </div>
    <div class="pic">
      <p class="play-title">商家实景</p>
      <div class="pic-box">
        <img v-for="item in pageData.pics" :key="item" :src="item" alt="" />
      </div>
    </div>
    <div class="time">
      <p class="play-title">营业时间：8：00</p>
    </div>
  </div>
</template>

<script setup>
import { getShopSeller } from "@/api/index.js";
import { ref, onMounted, computed } from "vue";
const pageData = ref([]);
onMounted(async () => {
  const res = await getShopSeller();
  console.log(res);
  pageData.value = res.data;
});
</script>

<style scoped lang="less">
div {
  font-size: 12px;
}
.merchant {
  padding: 16px 10px;
  p {
    font-size: 19px;
    font-weight: 700;
  }
  .rate {
    color: #999;
    height: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dddddd;
  }
  .price {
    margin-top: 10px;
    width: 100%;
    display: flex;
    justify-content: space-between;
  }

  .price-item {
    span {
      font-size: 11px;
      color: #999;
    }
    p {
      margin-top: 5px;
      color: #333;
      font-size: 20px;
      font-weight: 500;
      span {
        color: #000000;
        font-size: 12px;
      }
    }
  }

  .play-title {
    margin-top: 15px;
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: 700;
    color: #000000;
  }
  .supports {
    display: flex;
    align-items: center;
    margin-top: 10px;
    .before-div {
      width: 15px;
      height: 15px;
      text-align: center;
      line-height: 15px;
      margin-right: 5px;
      font-size: 10px;
    }
  }
  .pic {
    .pic-box {
      width: 100%;
      display: flex;
      justify-content: space-between;
      flex-wrap: wrap;
      img {
        width: 100px;
        height: 100px;
        margin-bottom: 10px;
      }
    }
  }
  .time {
    margin-bottom: 50px;
  }
}
</style>
